package meituan;

import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;

/**
 * @author Hang
 * @date 2022/8/13
 * @project AutumnOffer
 * @description
 **/
public class Card {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] card = new int[n];
        for(int i=0;i<n;i++){
            card[i] = scanner.nextInt();
        }
        int[] res = new int[n];
        LinkedList<Integer> list = new LinkedList<>();
        for(int i=0;i<n;i++){
            list.add(card[i]);
        }
        int i=0;
        while (!list.isEmpty()){
            Integer a = list.removeFirst();
            list.add(a);
            Integer b = list.removeFirst();
            list.add(b);
            Integer c = list.removeFirst();
            res[i] = c;
            i++;
        }
        for(int j=0;j<n;j++){
            System.out.print(res[j]+" ");
        }
    }
}
